﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
using VM.Entity.EntityMap.User;

namespace VM.Entity.EntityDto.Invoice
{
    /// <summary>
    /// 发票明细，支持填写商品明细最大2000行（包含折扣行、被折扣行）
    /// </summary>
    [SugarTable("invoice_applyDetail")]
    public class invoiceApplyDetailDto
    {

        #region Model
        private int _id;
        private int? _parentid;
        private string _goodsname;
        private string _goodscode;
        private string _selfcode;
        private string _withtaxflag;
        private string _price;
        private string _num;
        private string _unit;
        private string _spectype;
        private string _tax;
        private string _taxrate;
        private string _taxexcludedamount;
        private string _taxincludedamount;
        private string _invoicelineproperty;
        private string _favouredpolicyflag;
        private string _immediatetaxreturntype;
        private string _favouredpolicyname;
        private string _deduction;
        private string _zerorateflag;
        private string _dfield1;
        private string _dfield2;
        private string _dfield3;
        private string _dfield4;
        private string _dfield5;
        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, IsOnlyIgnoreInsert = true)]
        [JsonIgnore]
        public int id
        {
            set { _id = value; }
            get { return _id; }
        }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore]
        public int? parentId
        {
            set { _parentid = value; }
            get { return _parentid; }
        }
        /// <summary>
        /// 商品名称（如invoiceLineProperty =1，则此商品行为折扣行，折扣行不允许多行折扣，折扣行必须紧邻被折扣行，商品名称必须与被折扣行一致）
        /// </summary>
        public string goodsName
        {
            set { _goodsname = value; }
            get { return _goodsname; }
        }
        /// <summary>
        /// 商品编码（商品税收分类编码开发者自行填写） 必录
        /// </summary>
        public string? goodsCode
        {
            set { _goodscode = value; }
            get { return _goodscode; }
        }
        /// <summary>
        /// 自行编码（可不填）
        /// </summary>
        public string? selfCode
        {
            set { _selfcode = value; }
            get { return _selfcode; }
        }
        /// <summary>
        /// 单价含税标志：0:不含税,1:含税 必录
        /// </summary>
        public string? withTaxFlag
        {
            set { _withtaxflag = value; }
            get { return _withtaxflag; }
        }
        /// <summary>
        /// 单价（精确到小数点后8位），当单价(price)为空时，数量(num)也必须为空；(price)为空时，含税金额(taxIncludedAmount)、不含税金额(taxExcludedAmount)、税额(tax)都不能为空 
        /// </summary>
        public string? price
        {
            set { _price = value; }
            get { return _price; }
        }
        /// <summary>
        /// 数量（精确到小数点后8位，开具红票时数量为负数）
        /// </summary>
        public string? num
        {
            set { _num = value; }
            get { return _num; }
        }
        /// <summary>
        /// 单位
        /// </summary>
        public string? unit
        {
            set { _unit = value; }
            get { return _unit; }
        }
        /// <summary>
        /// 规格型号
        /// </summary>
        public string? specType
        {
            set { _spectype = value; }
            get { return _spectype; }
        }
        /// <summary>
        /// 税额（精确到小数点后2位），[不含税金额] * [税率] = [税额]；税额允许误差为 0.06。红票为负。不含税金额、税额、含税金额任何一个不传时，会根据传入的单价，数量进行计算，可能和实际数值存在误差，建议都传入
        /// </summary>
        public string? tax
        {
            set { _tax = value; }
            get { return _tax; }
        }
        /// <summary>
        /// 税率，注：1、纸票清单红票存在为null的情况；2、二手车发票税率为null或者0 必录
        /// </summary>
        public string? taxRate
        {
            set { _taxrate = value; }
            get { return _taxrate; }
        }
        /// <summary>
        /// 不含税金额（精确到小数点后2位）。红票为负。不含税金额、税额、含税金额任何一个不传时，会根据传入的单价，数量进行计算，可能和实际数值存在误差，建议都传入 必录
        /// </summary>
        public string? taxExcludedAmount
        {
            set { _taxexcludedamount = value; }
            get { return _taxexcludedamount; }
        }
        /// <summary>
        /// 含税金额（精确到小数点后2位），[不含税金额] + [税额] = [含税金额]，红票为负。不含税金额、税额、含税金额任何一个不传时，会根据传入的单价，数量进行计算，可能和实际数值存在误差，建议都传入 必录
        /// </summary>
        public string? taxIncludedAmount
        {
            set { _taxincludedamount = value; }
            get { return _taxincludedamount; }
        }
        /// <summary>
        /// 发票行性质：0,正常行;1,折扣行;2,被折扣行，红票只有正常行
        /// </summary>
        public string? invoiceLineProperty
        {
            set { _invoicelineproperty = value; }
            get { return _invoicelineproperty; }
        }
        /// <summary>
        /// 优惠政策标识：0,不使用;1,使用; 数电票时： 01：简易征收 02：稀土产品 03：免税 04：不征税 05：先征后退 06：100%先征后退 07：50%先征后退 08：按3%简易征收 09：按5%简易征收 10：按5%简易征收减按1.5%计征 11：即征即退30% 12：即征即退50% 13：即征即退70% 14：即征即退100% 15：超税负3%即征即退 16：超税负8%即征即退 17：超税负12%即征即退 18：超税负6%即征即退
        /// </summary>
        public string? favouredPolicyFlag
        {
            set { _favouredpolicyflag = value; }
            get { return _favouredpolicyflag; }
        }
        /// <summary>
        /// 即征即退类型标识：01-软件产品，02-资源综合利用产品 03-管道运输服务，04-有形动产融资租赁服务，05-有形动产融资性售后回租服务，06-新型墙体材料，07-风力发电产品，08-光伏发电产品，09-动漫软件产品，10-飞机维修劳务，11-黄金，12-铂金。已在税局进行增值税即征即退备案的企业，再开具商编属于即征即退类型范围内的商品时必传，可用于次月退税。非备案客户忽略。红票、折扣行不支持传入。
        /// </summary>
        public string? immediateTaxReturnType
        {
            set { _immediatetaxreturntype = value; }
            get { return _immediatetaxreturntype; }
        }
        /// <summary>
        /// 增值税特殊管理（优惠政策名称）,当favouredPolicyFlag为1时，此项必填 （数电票时为空）
        /// </summary>
        public string? favouredPolicyName
        {
            set { _favouredpolicyname = value; }
            get { return _favouredpolicyname; }
        }
        /// <summary>
        /// 扣除额，差额征收时填写，目前只支持填写一项。 注意：当传0、空或字段不传时，都表示非差额征税；传0.00才表示差额征税：0.00 （数电票暂不支持）
        /// </summary>
        public string? deduction
        {
            set { _deduction = value; }
            get { return _deduction; }
        }
        /// <summary>
        /// 零税率标识：空,非零税率;1,免税;2,不征税;3,普通零税率；1、当税率为：0%，且增值税特殊管理：为“免税”， 零税率标识：需传“1” 2、当税率为：0%，且增值税特殊管理：为"不征税" 零税率标识：需传“2” 3、当税率为：0%，且增值税特殊管理：为空 零税率标识：需传“3” （数电票时为空）
        /// </summary>
        public string? zeroRateFlag
        {
            set { _zerorateflag = value; }
            get { return _zerorateflag; }
        }
        /// <summary>
        /// 业务方明细自定义字段1，本应用只作保存
        /// </summary>
        public string? dField1
        {
            set { _dfield1 = value; }
            get { return _dfield1; }
        }
        /// <summary>
        /// 业务方明细自定义字段2，本应用只作保存
        /// </summary>
        public string? dField2
        {
            set { _dfield2 = value; }
            get { return _dfield2; }
        }
        /// <summary>
        /// 业务方明细自定义字段3，本应用只作保存
        /// </summary>
        public string? dField3
        {
            set { _dfield3 = value; }
            get { return _dfield3; }
        }
        /// <summary>
        /// 业务方明细自定义字段4，本应用只作保存
        /// </summary>
        public string? dField4
        {
            set { _dfield4 = value; }
            get { return _dfield4; }
        }
        /// <summary>
        /// 业务方明细自定义字段5，本应用只作保存
        /// </summary>
        public string? dField5
        {
            set { _dfield5 = value; }
            get { return _dfield5; }
        }
        #endregion Model


    }
}
